package org.qf.test;

import org.qf.dao.SmbmsUserDao;
import org.qf.dao.impl.SmbmsUserDaoImpl;
import org.qf.pojo.SmbmsUser;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;


/**
 * @author young
 * @create 2021-01-12-19:20
 * @description
 */
public class test {
    private static PreparedStatement preparedStatement;
    private static Connection connection;

    public static void main(String[] args) throws SQLException {
//        SmbmsUserDao smbmsUserDao=new SmbmsUserDaoImpl();
//        try {
//            List<SmbmsUser> list= (List<SmbmsUser>) smbmsUserDao.queryUserByUserCode("admin");
//            for (SmbmsUser smbmsUser:list)
//            {
//                System.out.println(smbmsUser.getId());
//
//            }        } catch (Exception e) {
//            e.printStackTrace();
//        }
        preparedStatement  = connection.prepareStatement("select * from smbms_user2");
        ResultSet resultSet=preparedStatement.executeQuery();
        if(resultSet==null)
        {
            System.out.println("kong");
        }
        while(resultSet.next()){
            int id = resultSet.getInt(1);
            System.out.println("id:"+id);
        }

    }
}
